package BitCreeekClient;

import java.io.Serializable;

public class Part implements IPart, Serializable {

    int size;
    PartStatusType status;
    int availability;

    public Part ( int size, PartStatusType statusType ) {
        this.size = size;
        this.status = statusType;
    }

    public int getSize () {
        return size;
    }

    public void setAvailability ( int i ) {
        this.availability = i;
    }

    public int getAvailability () {
        return this.availability;
    }

    public String toString () {
        return "Size: " + size + " | complete: " + status.toString () + " | avaib: " + availability;
    }

    public void setComplete () {
        this.status = PartStatusType.COMPLETE;
    }

    public void setIncomplete () {
        this.status = PartStatusType.INCOMPLETE;
    }

    public void setDownloading () {
        this.status = PartStatusType.DOWNLOADING;
    }

    public PartStatusType getStatus () {
        return this.status;
    }

}
